<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="jquery.min.js"></script>
    <title>Document</title>
</head>
<body>
    <input type="text" id="input">

    <script>
        var input = jQuery("#input");
        jQuery.ajax({
            url:"/timer",
            type:"post",
            data:{"input": input.val()},
            success:function(res) {
                if( res.data == -1) {
                    alert("当前验证码已失效, 请重新发送!");
                    input.focus();
                    return false;
                }
            }
        });
        
    </script>
</body>
</html>